package org.jeecg.modules.assets.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.jeecg.modules.assets.entity.AssetsInfoWorn;
import org.jeecg.modules.assets.mapper.AssetsInfoWornMapper;
import org.jeecg.modules.assets.service.IAssetsInfoService;
import org.jeecg.modules.assets.service.IAssetsInfoWornService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 设备预警管理
 * @Author: jeecg-boot
 * @Date: 2024-11-08
 * @Version: V1.0
 */
@Service
public class AssetsInfoWornServiceImpl extends ServiceImpl<AssetsInfoWornMapper, AssetsInfoWorn> implements IAssetsInfoWornService {
    @Autowired
    private IAssetsInfoService assetsInfoService;

    @Override
    public void editWron(AssetsInfoWorn assetsInfoWorn) {
        this.updateById(assetsInfoWorn);
        //设置
        UpdateWrapper qw = new UpdateWrapper();
        qw.eq("asset_name", assetsInfoWorn.getAssetName());
        qw.set("warn_num", assetsInfoWorn.getWarnNum());
        assetsInfoService.update(null, qw);

    }
}
